<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CryptoAuthLib: atca_jwt.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CryptoAuthLib
   </div>
   <div id="projectbrief">Microchip CryptoAuthentication Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00530_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">atca_jwt.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a00530.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#ifndef ATCA_JWT_H_</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define ATCA_JWT_H_</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00299.html">cryptoauthlib.h</a>&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="a03759.html">   38</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;{</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="a03759.html#a1fe855c208bc17a51a4d34fefdb2d5b1">   40</a></span>&#160;    <span class="keywordtype">char</span>*    <a class="code" href="a03759.html#a1fe855c208bc17a51a4d34fefdb2d5b1">buf</a>;          <span class="comment">/* Input buffer */</span></div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="a03759.html#a892366b22e8ea42d95e49308022eef4d">   41</a></span>&#160;    uint16_t <a class="code" href="a03759.html#a892366b22e8ea42d95e49308022eef4d">buflen</a>;       <span class="comment">/* Total buffer size */</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="a03759.html#aee7e8f6f5f1a4b5b402473cf99d3042a">   42</a></span>&#160;    uint16_t <a class="code" href="a03759.html#aee7e8f6f5f1a4b5b402473cf99d3042a">cur</a>;          <span class="comment">/* Current location in the buffer */</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;} <a class="code" href="a03759.html">atca_jwt_t</a>;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<a class="code" href="a00128.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a03539.html#gad3ea09543f0569a5368130f4a3d7bce0">atca_jwt_init</a>(<a class="code" href="a03759.html">atca_jwt_t</a>* jwt, <span class="keywordtype">char</span>* buf, uint16_t buflen);</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<a class="code" href="a00128.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a03539.html#ga3e6036b2c0e6dbc96a30f078e56cacff">atca_jwt_add_claim_string</a>(<a class="code" href="a03759.html">atca_jwt_t</a>* jwt, <span class="keyword">const</span> <span class="keywordtype">char</span>* claim, <span class="keyword">const</span> <span class="keywordtype">char</span>* value);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<a class="code" href="a00128.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a03539.html#ga7073a7cfb7c77ad02923cdbb1226d2ad">atca_jwt_add_claim_numeric</a>(<a class="code" href="a03759.html">atca_jwt_t</a>* jwt, <span class="keyword">const</span> <span class="keywordtype">char</span>* claim, int32_t value);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<a class="code" href="a00128.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a03539.html#ga6d1bf5c8bf4fb49e1e80c19911157d4b">atca_jwt_finalize</a>(<a class="code" href="a03759.html">atca_jwt_t</a>* jwt, uint16_t key_id);</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03539.html#ga167fe35631a0dd191293c6ad3a6485aa">atca_jwt_check_payload_start</a>(<a class="code" href="a03759.html">atca_jwt_t</a>* jwt);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<a class="code" href="a00128.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a03539.html#ga0e2ca8c9bd4954e004cd10cdc29c9a9b">atca_jwt_verify</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* buf, uint16_t buflen, <span class="keyword">const</span> uint8_t* pubkey);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* ATCA_JWT_H_ */</span><span class="preprocessor"></span></div><div class="ttc" id="a00128_html_a22bd6643f31f1d75dc3e7ea939f468cd"><div class="ttname"><a href="a00128.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a></div><div class="ttdeci">ATCA_STATUS</div><div class="ttdef"><b>Definition:</b> atca_status.h:41</div></div>
<div class="ttc" id="a03759_html"><div class="ttname"><a href="a03759.html">atca_jwt_t</a></div><div class="ttdoc">Structure to hold metadata information about the jwt being built. </div><div class="ttdef"><b>Definition:</b> atca_jwt.h:38</div></div>
<div class="ttc" id="a03539_html_ga0e2ca8c9bd4954e004cd10cdc29c9a9b"><div class="ttname"><a href="a03539.html#ga0e2ca8c9bd4954e004cd10cdc29c9a9b">atca_jwt_verify</a></div><div class="ttdeci">ATCA_STATUS atca_jwt_verify(const char *buf, uint16_t buflen, const uint8_t *pubkey)</div><div class="ttdoc">Verifies the signature of a jwt using the provided public key. </div><div class="ttdef"><b>Definition:</b> atca_jwt.c:285</div></div>
<div class="ttc" id="a03759_html_a892366b22e8ea42d95e49308022eef4d"><div class="ttname"><a href="a03759.html#a892366b22e8ea42d95e49308022eef4d">atca_jwt_t::buflen</a></div><div class="ttdeci">uint16_t buflen</div><div class="ttdef"><b>Definition:</b> atca_jwt.h:41</div></div>
<div class="ttc" id="a00299_html"><div class="ttname"><a href="a00299.html">cryptoauthlib.h</a></div><div class="ttdoc">Single aggregation point for all CryptoAuthLib header files. </div></div>
<div class="ttc" id="a03759_html_aee7e8f6f5f1a4b5b402473cf99d3042a"><div class="ttname"><a href="a03759.html#aee7e8f6f5f1a4b5b402473cf99d3042a">atca_jwt_t::cur</a></div><div class="ttdeci">uint16_t cur</div><div class="ttdef"><b>Definition:</b> atca_jwt.h:42</div></div>
<div class="ttc" id="a03539_html_ga3e6036b2c0e6dbc96a30f078e56cacff"><div class="ttname"><a href="a03539.html#ga3e6036b2c0e6dbc96a30f078e56cacff">atca_jwt_add_claim_string</a></div><div class="ttdeci">ATCA_STATUS atca_jwt_add_claim_string(atca_jwt_t *jwt, const char *claim, const char *value)</div><div class="ttdoc">Add a string claim to a token. </div><div class="ttdef"><b>Definition:</b> atca_jwt.c:215</div></div>
<div class="ttc" id="a03539_html_gad3ea09543f0569a5368130f4a3d7bce0"><div class="ttname"><a href="a03539.html#gad3ea09543f0569a5368130f4a3d7bce0">atca_jwt_init</a></div><div class="ttdeci">ATCA_STATUS atca_jwt_init(atca_jwt_t *jwt, char *buf, uint16_t buflen)</div><div class="ttdoc">Initialize a JWT structure. </div><div class="ttdef"><b>Definition:</b> atca_jwt.c:64</div></div>
<div class="ttc" id="a03539_html_ga6d1bf5c8bf4fb49e1e80c19911157d4b"><div class="ttname"><a href="a03539.html#ga6d1bf5c8bf4fb49e1e80c19911157d4b">atca_jwt_finalize</a></div><div class="ttdeci">ATCA_STATUS atca_jwt_finalize(atca_jwt_t *jwt, uint16_t key_id)</div><div class="ttdoc">Close the claims of a token, encode them, then sign the result. </div><div class="ttdef"><b>Definition:</b> atca_jwt.c:105</div></div>
<div class="ttc" id="a03539_html_ga167fe35631a0dd191293c6ad3a6485aa"><div class="ttname"><a href="a03539.html#ga167fe35631a0dd191293c6ad3a6485aa">atca_jwt_check_payload_start</a></div><div class="ttdeci">void atca_jwt_check_payload_start(atca_jwt_t *jwt)</div><div class="ttdoc">Check the provided context to see what character needs to be added in order to append a claim...</div><div class="ttdef"><b>Definition:</b> atca_jwt.c:41</div></div>
<div class="ttc" id="a03539_html_ga7073a7cfb7c77ad02923cdbb1226d2ad"><div class="ttname"><a href="a03539.html#ga7073a7cfb7c77ad02923cdbb1226d2ad">atca_jwt_add_claim_numeric</a></div><div class="ttdeci">ATCA_STATUS atca_jwt_add_claim_numeric(atca_jwt_t *jwt, const char *claim, int32_t value)</div><div class="ttdoc">Add a numeric claim to a token. </div><div class="ttdef"><b>Definition:</b> atca_jwt.c:251</div></div>
<div class="ttc" id="a03759_html_a1fe855c208bc17a51a4d34fefdb2d5b1"><div class="ttname"><a href="a03759.html#a1fe855c208bc17a51a4d34fefdb2d5b1">atca_jwt_t::buf</a></div><div class="ttdeci">char * buf</div><div class="ttdef"><b>Definition:</b> atca_jwt.h:40</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_0f8c318486f9c8f97febe2dc0542d496.html">jwt</a></li><li class="navelem"><a class="el" href="a00530.html">atca_jwt.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
